@echo off
REM Time-delay method
REM Usage: mdelay [millisecond]

REM time delay can be implemented by
REM choice/ping command or wscript ways.
if "%~1" == "" (
    choice /t 1 /d y 2>nul 1>nul
    if ERRORLEVEL == 1 goto END
    ping 127.1 -n 1 -w 1000 2>nul 1>nul
) else (
    echo wscript.sleep %1>%~n0_sleep.vbs
    start /min /wait %~n0_sleep.vbs 2>nul
    del /f /q %~n0_sleep.vbs
) 

:END
